package lec10api2;

import java.util.Arrays;

public class E {
    public static void main(String[] args) {
        int[] a = new int[]{1, 1, 6, 3, 3};
        Arrays.sort(a);
        int[] dp = new int[a.length];//dp[x]  以a[x]结尾的序列中a[x]出现的次数
        dp[0] = 1;
        for (int i = 1; i < a.length; i++) {
            if (a[i] == a[i - 1]) {
                dp[i] = dp[i - 1] + 1;
            } else {
                dp[i] = 1;
            }
        }
        System.out.println(Arrays.toString(dp));

    }
}
